const mongoose = require('mongoose')

const joi = require('joi')

const Article = mongoose.model('Article', new mongoose.Schema({
  title: {
    type: String,
    required: true
  },
  time: {
    type: Date,
    default: Date.now
  },
  writer: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User',
    required: true
  },
  cover: {
    type: String,
    default: null
  },
  content: {
    type: String
  }
}))

module.exports = {
  Article
}